package com.cc.dingtalk;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @author CC
 * @version 1.0
 * @description: 封装发送钉钉消息的参数
 * @date 2025/10/14 15:14
 */
@Data
public class SendRequestParam {
    private SendRequestParam.ActionCard actionCard;
    private SendRequestParam.At at;
    private SendRequestParam.FeedCard feedCard;
    private SendRequestParam.Link link;
    private SendRequestParam.Markdown markdown;
    private SendRequestParam.Text text;
    private String msgtype;
    //文本通知
    @Data
    public static class Text implements Serializable
    {
        private static final long serialVersionUID = 2112411828946494293L;

        private String content;
    }
    // 带链接的通知
    @Data
    public static class Link implements Serializable
    {
        private static final long serialVersionUID = 7833398226941254374L;
        //消息链接地址
        private String messageUrl;
        //图片链接地址
        private String picUrl;
        //消息内容
        private String text;
        //标题
        private String title;
    }
    // makrdown格式 通知
    @Data
    public static class Markdown implements Serializable
    {
        private static final long serialVersionUID = 4697553615692276546L;
        private String text;
        private String title;
    }
    //
    @Data
    public static class At implements Serializable
    {
        private static final long serialVersionUID = 6328897894299426499L;
        private List<String> atMobiles;
        private List<String> atUserIds;
        private Boolean isAtAll;
    }

    //ActionCard 通知
    @Data
    public static class ActionCard implements Serializable
    {
        private static final long serialVersionUID = 1553944892187227581L;
        private String btnOrientation;
        private List<SendRequestParam.Btns> btns;
        private String hideAvatar;
        private String singleTitle;
        private String singleURL;
        private String text;
        private String title;
    }
    // FeedCard 通知
    @Data
    public static class FeedCard implements Serializable
    {
        private static final long serialVersionUID = 6578287939968676945L;
        private List<SendRequestParam.Links> links;
    }

    @Data
    public static class Btns implements Serializable
    {
        private static final long serialVersionUID = 4435422339746837645L;
        private String actionURL;
        private String title;
    }

    @Data
    public static class Links implements Serializable
    {
        private static final long serialVersionUID = 7496318843524412877L;
        private String messageURL;
        private String picURL;
        private String title;
    }


}
